#include <iostream>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    long long roads[51] = {0};
    int i, a, b, n;
    roads[1] = 1;
    roads[2] = 1;
    roads[3] = 2;
    for (i = 4; i < 51; i++)
    {
        roads[i] = roads[i - 1] + roads[i - 2];
    }
    cin >> n;
    while (n--)
    {
        cin >> a >> b;
        cout << roads[b - a + 1] << endl;
    }
    return 0;
}